<template>
  <transition name="slide-down">
    <div class="title-wrapper" v-show="ifTitleAndMenuShow">
      <div class="left" @click="prev()">
        <span class="iconfont iconback">返回</span>
      </div>
      <div class="right">
        <!-- <div class="icon-wrapper">
          <span class="iconfont iconcart"></span>
        </div>
        <div class="icon-wrapper">
          <span class="iconfont icongerenzhongxin"></span>
        </div> -->
        <div class="icon-wrapper">
          <span>{{resDATA.title}}</span>
        </div>
      </div>
    </div>
  </transition>
</template>

<script>
export default {
  name: 'titleBar',
  props: {
    ifTitleAndMenuShow: {
      type: Boolean,
      default: true
    },
    resDATA:{},
  },
  methods: {
    prev(){
      this.$router.go(-1)
    }
  }
}
</script>

<style lang="scss" scoped>
  @import '~styles/global';
  .title-wrapper{
    display: flex;
    width: 75%;
    height: px2rem(48);
    position: fixed;
    top: 0;
    left: 25%;
    background-color: #ffffff;
    box-shadow: 0 px2rem(8) px2rem(8) rgba(0,0,0,0.15);
    z-index: 101;
    .left{
      flex: 0 0 px2rem(60);
      @include center();
      cursor: pointer;
    }
    .right{
      flex: 1;
      display: flex;
      justify-content: flex-end;
      .icon-wrapper{
        font-size: 25px;
        line-height: px2rem(48);
        padding-right: 0.5rem;
      }
    }
  }
</style>
